package org.iteam.xlz.manager.action.membershipcard;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.iteam.web.struts.action.AbstractModuleAction;
import org.iteam.web.struts.action.RestAction;
import org.iteam.xlz.core.entity.membershipcard.LogMemberShipAccount;
import org.iteam.xlz.core.service.membershipcard.CardAccountService;

@SuppressWarnings("unchecked")
@Results({@Result(name="INDEX",type="freemarker",location="/WEB-INF/content/membershipcard/account/account-index.html")})
public class CardAccountAction extends AbstractModuleAction<LogMemberShipAccount> implements RestAction{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7661069417346983853L;
	private final String PATH="/membershipcard/account";
	@Override
	public LogMemberShipAccount getModel() {
		if(null==model){
			model=new LogMemberShipAccount();
		}
		return model;
	}

	@Override
	@Action(PATH+"/index")
	public String index() throws Exception {
		return INDEX;
	}

	@Override
	@Action(PATH+"/query")
	public String query() {
		map.put("total",CardAccountService.getInstance().counts(_mid,_logtype));
		map.put("rows",CardAccountService.getInstance().query(_mid,_logtype,page,rows));
		return MAP;
	}

	@Override
	public String show() {
		return null;
	}

	@Override
	public String create() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

	@Override
	public String delete() {
		return null;
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() throws Exception {
		return null;
	}

	@Override
	public String editNew() throws Exception {
		return null;
	}
	
	private String _mid;
	private String _logtype;
	public void set_mid(String _mid) {
		this._mid = _mid;
	}

	public void set_logtype(String _logtype) {
		this._logtype = _logtype;
	}

}
